package communication.server;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.util.ArrayList;

import communication.Message;
import communication.MessageType;
import communication.message.Player;

public class ClientHandle extends Handle {
	private String gameId;
	
	public ClientHandle(DataInputStream input, DataOutputStream output) {
		super(input, output);
	}

	public void disconnect() throws IOException {
		super.disconnect();
	}

	public void sendMessage(Message msg) throws IOException {
		super.send(msg);
	}
	
	public void setGameId(String gameId) {
		this.gameId = gameId;
	}
	
	public String getGameId() {
		return gameId;
	}
	
	public void sendChampionList(ArrayList<Player> players) throws IOException {
		Message msg = new Message(MessageType.CHAMPION_LIST);
		for(Player player : players)
			msg.addPlayer(player);
		super.send(msg);
	}
}